<?php
$statues = '';
$class   = '';
$statues = '';
$message = '';
if ($sf_user->hasFlash('message_success'))
{
    $class   = 'alert-success';
    $statues = 'Success';
    $message = $sf_user->getFlash('message_success');
    $sf_user->setFlash('message_success', null);
}
elseif ($sf_user->hasFlash('message_failed'))
{
    $class   = 'alert-error';
    $statues = 'Error';
    $message = $sf_user->getFlash('message_failed');
    $sf_user->setFlash('message_failed', null);
}
elseif ($sf_user->hasFlash('message_warning'))
{
    $class   = '';
    $statues = 'Warning';
    $message = $sf_user->getFlash('message_warning');
    $sf_user->setFlash('message_warning', null);
}
elseif ($sf_user->hasFlash('message_info'))
{
    $class   = 'alert-info';
    $statues = 'Information';
    $message = $sf_user->getFlash('message_info');
    $sf_user->setFlash('message_info', null);
}
?>
<?php if ($statues): ?>
    <div class="alert <?php echo $class ?> clear">
        <button type="button" class="close" >×</button>
        <strong><?php echo $statues ?>!</strong> <?php echo $message ?>.
    </div>

    <script>
        $('button.close').click(function() {
            $(this).parent().slideUp(); 
        });
        setTimeout(function(){
            $('.close').click()
        },2500)
    </script>
<?php endif; ?>


